# !pip install git+https://github.com/alberanid/imdbpy
# !pip install pandas
# !pip install numpy
# !pip install matplotlib
# !pip install seaborn
# !pip install pandas_profiling --upgrade
# !pip install plotly
# !pip install wordcloud
# !pip install Flask
# Import Dataset
# Import File from Loacal Drive
# from google.colab import files
# data_to_load = files.upload()
# from google.colab import drive
# drive.mount('/content/drive')
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
import collections
import plotly.express as px
import plotly.graph_objects as go
import nltk
import re
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.probability import FreqDist
from nltk.util import ngrams
from plotly.subplots import make_subplots
from plotly.offline import iplot, init_notebook_mode
from wordcloud import WordCloud, STOPWORDS
from pandas_profiling import ProfileReport
%matplotlib inline
warnings.filterwarnings("ignore")
nltk.download('all')
[nltk_data] Downloading collection 'all' [nltk_data] | [nltk_data] | Downloading package abc to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package abc is already up-to-date! [nltk_data] | Downloading package alpino to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package alpino is already up-to-date! [nltk_data] | Downloading package biocreative_ppi to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package biocreative_ppi is already up-to-date! [nltk_data] | Downloading package brown to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package brown is already up-to-date! [nltk_data] | Downloading package brown_tei to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package brown_tei is already up-to-date! [nltk_data] | Downloading package cess_cat to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package cess_cat is already up-to-date! [nltk_data] | Downloading package cess_esp to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package cess_esp is already up-to-date! [nltk_data] | Downloading package chat80 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package chat80 is already up-to-date! [nltk_data] | Downloading package city_database to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package city_database is already up-to-date! [nltk_data] | Downloading package cmudict to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package cmudict is already up-to-date! [nltk_data] | Downloading package comparative_sentences to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package comparative_sentences is already up-to- [nltk_data] | date! [nltk_data] | Downloading package comtrans to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package comtrans is already up-to-date! [nltk_data] | Downloading package conll2000 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package conll2000 is already up-to-date! [nltk_data] | Downloading package conll2002 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package conll2002 is already up-to-date! [nltk_data] | Downloading package conll2007 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package conll2007 is already up-to-date! [nltk_data] | Downloading package crubadan to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package crubadan is already up-to-date! [nltk_data] | Downloading package dependency_treebank to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package dependency_treebank is already up-to-date! [nltk_data] | Downloading package dolch to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package dolch is already up-to-date! [nltk_data] | Downloading package europarl_raw to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package europarl_raw is already up-to-date! [nltk_data] | Downloading package floresta to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package floresta is already up-to-date! [nltk_data] | Downloading package framenet_v15 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package framenet_v15 is already up-to-date! [nltk_data] | Downloading package framenet_v17 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package framenet_v17 is already up-to-date! [nltk_data] | Downloading package gazetteers to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package gazetteers is already up-to-date! [nltk_data] | Downloading package genesis to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package genesis is already up-to-date! [nltk_data] | Downloading package gutenberg to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package gutenberg is already up-to-date! [nltk_data] | Downloading package ieer to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package ieer is already up-to-date! [nltk_data] | Downloading package inaugural to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package inaugural is already up-to-date! [nltk_data] | Downloading package indian to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package indian is already up-to-date! [nltk_data] | Downloading package jeita to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package jeita is already up-to-date! [nltk_data] | Downloading package kimmo to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package kimmo is already up-to-date! [nltk_data] | Downloading package knbc to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package knbc is already up-to-date! [nltk_data] | Downloading package lin_thesaurus to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package lin_thesaurus is already up-to-date! [nltk_data] | Downloading package mac_morpho to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package mac_morpho is already up-to-date! [nltk_data] | Downloading package machado to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package machado is already up-to-date! [nltk_data] | Downloading package masc_tagged to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package masc_tagged is already up-to-date! [nltk_data] | Downloading package moses_sample to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package moses_sample is already up-to-date! [nltk_data] | Downloading package movie_reviews to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package movie_reviews is already up-to-date! [nltk_data] | Downloading package names to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package names is already up-to-date! [nltk_data] | Downloading package nombank.1.0 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package nombank.1.0 is already up-to-date! [nltk_data] | Downloading package nps_chat to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package nps_chat is already up-to-date! [nltk_data] | Downloading package omw to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package omw is already up-to-date! [nltk_data] | Downloading package opinion_lexicon to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package opinion_lexicon is already up-to-date! [nltk_data] | Downloading package paradigms to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package paradigms is already up-to-date! [nltk_data] | Downloading package pil to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package pil is already up-to-date! [nltk_data] | Downloading package pl196x to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package pl196x is already up-to-date! [nltk_data] | Downloading package ppattach to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package ppattach is already up-to-date! [nltk_data] | Downloading package problem_reports to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package problem_reports is already up-to-date! [nltk_data] | Downloading package propbank to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package propbank is already up-to-date! [nltk_data] | Downloading package ptb to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package ptb is already up-to-date! [nltk_data] | Downloading package product_reviews_1 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package product_reviews_1 is already up-to-date! [nltk_data] | Downloading package product_reviews_2 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package product_reviews_2 is already up-to-date! [nltk_data] | Downloading package pros_cons to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package pros_cons is already up-to-date! [nltk_data] | Downloading package qc to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package qc is already up-to-date! [nltk_data] | Downloading package reuters to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package reuters is already up-to-date! [nltk_data] | Downloading package rte to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package rte is already up-to-date! [nltk_data] | Downloading package semcor to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package semcor is already up-to-date! [nltk_data] | Downloading package senseval to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package senseval is already up-to-date! [nltk_data] | Downloading package sentiwordnet to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package sentiwordnet is already up-to-date! [nltk_data] | Downloading package sentence_polarity to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package sentence_polarity is already up-to-date! [nltk_data] | Downloading package shakespeare to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package shakespeare is already up-to-date! [nltk_data] | Downloading package sinica_treebank to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package sinica_treebank is already up-to-date! [nltk_data] | Downloading package smultron to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package smultron is already up-to-date! [nltk_data] | Downloading package state_union to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package state_union is already up-to-date! [nltk_data] | Downloading package stopwords to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package stopwords is already up-to-date! [nltk_data] | Downloading package subjectivity to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package subjectivity is already up-to-date! [nltk_data] | Downloading package swadesh to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package swadesh is already up-to-date! [nltk_data] | Downloading package switchboard to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package switchboard is already up-to-date! [nltk_data] | Downloading package timit to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package timit is already up-to-date! [nltk_data] | Downloading package toolbox to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package toolbox is already up-to-date! [nltk_data] | Downloading package treebank to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package treebank is already up-to-date! [nltk_data] | Downloading package twitter_samples to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package twitter_samples is already up-to-date! [nltk_data] | Downloading package udhr to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package udhr is already up-to-date! [nltk_data] | Downloading package udhr2 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package udhr2 is already up-to-date! [nltk_data] | Downloading package unicode_samples to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package unicode_samples is already up-to-date! [nltk_data] | Downloading package universal_treebanks_v20 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package universal_treebanks_v20 is already up-to- [nltk_data] | date! [nltk_data] | Downloading package verbnet to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package verbnet is already up-to-date! [nltk_data] | Downloading package verbnet3 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package verbnet3 is already up-to-date! [nltk_data] | Downloading package webtext to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package webtext is already up-to-date! [nltk_data] | Downloading package wordnet to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package wordnet is already up-to-date! [nltk_data] | Downloading package wordnet_ic to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package wordnet_ic is already up-to-date! [nltk_data] | Downloading package words to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package words is already up-to-date! [nltk_data] | Downloading package ycoe to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package ycoe is already up-to-date! [nltk_data] | Downloading package rslp to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package rslp is already up-to-date! [nltk_data] | Downloading package maxent_treebank_pos_tagger to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package maxent_treebank_pos_tagger is already up- [nltk_data] | to-date! [nltk_data] | Downloading package universal_tagset to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package universal_tagset is already up-to-date! [nltk_data] | Downloading package maxent_ne_chunker to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package maxent_ne_chunker is already up-to-date! [nltk_data] | Downloading package punkt to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package punkt is already up-to-date! [nltk_data] | Downloading package book_grammars to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package book_grammars is already up-to-date! [nltk_data] | Downloading package sample_grammars to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package sample_grammars is already up-to-date! [nltk_data] | Downloading package spanish_grammars to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package spanish_grammars is already up-to-date! [nltk_data] | Downloading package basque_grammars to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package basque_grammars is already up-to-date! [nltk_data] | Downloading package large_grammars to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package large_grammars is already up-to-date! [nltk_data] | Downloading package tagsets to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package tagsets is already up-to-date! [nltk_data] | Downloading package snowball_data to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package snowball_data is already up-to-date! [nltk_data] | Downloading package bllip_wsj_no_aux to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package bllip_wsj_no_aux is already up-to-date! [nltk_data] | Downloading package word2vec_sample to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package word2vec_sample is already up-to-date! [nltk_data] | Downloading package panlex_swadesh to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package panlex_swadesh is already up-to-date! [nltk_data] | Downloading package mte_teip5 to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package mte_teip5 is already up-to-date! [nltk_data] | Downloading package averaged_perceptron_tagger to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package averaged_perceptron_tagger is already up- [nltk_data] | to-date! [nltk_data] | Downloading package averaged_perceptron_tagger_ru to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package averaged_perceptron_tagger_ru is already [nltk_data] | up-to-date! [nltk_data] | Downloading package perluniprops to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package perluniprops is already up-to-date! [nltk_data] | Downloading package nonbreaking_prefixes to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package nonbreaking_prefixes is already up-to-date! [nltk_data] | Downloading package vader_lexicon to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package vader_lexicon is already up-to-date! [nltk_data] | Downloading package porter_test to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package porter_test is already up-to-date! [nltk_data] | Downloading package wmt15_eval to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package wmt15_eval is already up-to-date! [nltk_data] | Downloading package mwa_ppdb to [nltk_data] | C:\Users\pawan\AppData\Roaming\nltk_data... [nltk_data] | Package mwa_ppdb is already up-to-date! [nltk_data] | [nltk_data] Done downloading collection all
True
# path = '/content/drive/MyDrive/Files/'
path = 'C:\\Users\\pawan\\OneDrive\\Desktop\\ott\\Data\\'
df_tvshows = pd.read_csv(path + 'otttvshows.csv')
df_tvshows.head()
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | Language | Plotline | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | Snowpiercer | 2013 | 18+ | 6.9 | 94% | NaN | Daveed Diggs,Iddo Goldberg,Mickey Sumner,Aliso... | Action,Drama,Sci-Fi,Thriller | United States | English | Set seven years after the world has become a f... | 60.0 | tv series | 3.0 | 1 | 0 | 0 | 0 | 1 |
| 1 | 2 | Philadelphia | 1993 | 13+ | 8.8 | 80% | NaN | Charlie Day,Glenn Howerton,Rob McElhenney,Kait... | Comedy | United States | English | The gang, 5 raging alcoholic, narcissists run ... | 22.0 | tv series | 18.0 | 1 | 0 | 0 | 0 | 1 |
| 2 | 3 | Roma | 2018 | 18+ | 8.7 | 93% | NaN | Kevin McKidd,Ray Stevenson,Polly Walker,Kerry ... | Action,Drama,History,Romance,War | United Kingdom,United States | English | In this British historical drama, the turbulen... | 52.0 | tv series | 2.0 | 1 | 0 | 0 | 0 | 1 |
| 3 | 4 | Amy | 2015 | 18+ | 7.0 | 87% | NaN | Amy Brenneman,Richard T. Jones,Jessica Tuck,Ma... | Drama | United States | English | A family drama focused on three generations of... | 60.0 | tv series | 6.0 | 1 | 0 | 1 | 1 | 1 |
| 4 | 5 | The Young Offenders | 2016 | NaN | 8.0 | 100% | NaN | Alex Murphy,Chris Walley,Hilary Rose,Dominic M... | Comedy | United Kingdom,Ireland | English | NaN | 30.0 | tv series | 3.0 | 1 | 0 | 0 | 0 | 1 |
# profile = ProfileReport(df_tvshows)
# profile
def data_investigate(df):
print('No of Rows : ', df.shape[0])
print('No of Coloums : ', df.shape[1])
print('**'*25)
print('Colums Names : \n', df.columns)
print('**'*25)
print('Datatype of Columns : \n', df.dtypes)
print('**'*25)
print('Missing Values : ')
c = df.isnull().sum()
c = c[c > 0]
print(c)
print('**'*25)
print('Missing vaules %age wise :\n')
print((100*(df.isnull().sum()/len(df.index))))
print('**'*25)
print('Pictorial Representation : ')
plt.figure(figsize = (10, 10))
sns.heatmap(df.isnull(), yticklabels = False, cbar = False)
plt.show()
data_investigate(df_tvshows)
No of Rows : 5432
No of Coloums : 20
**************************************************
Colums Names :
Index(['ID', 'Title', 'Year', 'Age', 'IMDb', 'Rotten Tomatoes', 'Directors',
'Cast', 'Genres', 'Country', 'Language', 'Plotline', 'Runtime', 'Kind',
'Seasons', 'Netflix', 'Hulu', 'Prime Video', 'Disney+', 'Type'],
dtype='object')
**************************************************
Datatype of Columns :
ID int64
Title object
Year int64
Age object
IMDb float64
Rotten Tomatoes object
Directors object
Cast object
Genres object
Country object
Language object
Plotline object
Runtime float64
Kind object
Seasons float64
Netflix int64
Hulu int64
Prime Video int64
Disney+ int64
Type int64
dtype: object
**************************************************
Missing Values :
Age 1954
IMDb 556
Rotten Tomatoes 4194
Directors 5158
Cast 486
Genres 323
Country 549
Language 638
Plotline 2493
Runtime 1410
Seasons 679
dtype: int64
**************************************************
Missing vaules %age wise :
ID 0.000000
Title 0.000000
Year 0.000000
Age 35.972018
IMDb 10.235641
Rotten Tomatoes 77.209131
Directors 94.955817
Cast 8.946981
Genres 5.946244
Country 10.106775
Language 11.745214
Plotline 45.894698
Runtime 25.957290
Kind 0.000000
Seasons 12.500000
Netflix 0.000000
Hulu 0.000000
Prime Video 0.000000
Disney+ 0.000000
Type 0.000000
dtype: float64
**************************************************
Pictorial Representation :
# ID
# df_tvshows = df_tvshows.drop(['ID'], axis = 1)
# Age
df_tvshows.loc[df_tvshows['Age'].isnull() & df_tvshows['Disney+'] == 1, "Age"] = '13'
# df_tvshows.fillna({'Age' : 18}, inplace = True)
df_tvshows.fillna({'Age' : 'NR'}, inplace = True)
df_tvshows['Age'].replace({'all': '0'}, inplace = True)
df_tvshows['Age'].replace({'7+': '7'}, inplace = True)
df_tvshows['Age'].replace({'13+': '13'}, inplace = True)
df_tvshows['Age'].replace({'16+': '16'}, inplace = True)
df_tvshows['Age'].replace({'18+': '18'}, inplace = True)
# df_tvshows['Age'] = df_tvshows['Age'].astype(int)
# IMDb
# df_tvshows.fillna({'IMDb' : df_tvshows['IMDb'].mean()}, inplace = True)
# df_tvshows.fillna({'IMDb' : df_tvshows['IMDb'].median()}, inplace = True)
df_tvshows.fillna({'IMDb' : "NA"}, inplace = True)
# Rotten Tomatoes
df_tvshows['Rotten Tomatoes'] = df_tvshows['Rotten Tomatoes'][df_tvshows['Rotten Tomatoes'].notnull()].str.replace('%', '').astype(int)
# df_tvshows['Rotten Tomatoes'] = df_tvshows['Rotten Tomatoes'][df_tvshows['Rotten Tomatoes'].notnull()].astype(int)
# df_tvshows.fillna({'Rotten Tomatoes' : df_tvshows['Rotten Tomatoes'].mean()}, inplace = True)
# df_tvshows.fillna({'Rotten Tomatoes' : df_tvshows['Rotten Tomatoes'].median()}, inplace = True)
# df_tvshows['Rotten Tomatoes'] = df_tvshows['Rotten Tomatoes'].astype(int)
df_tvshows.fillna({'Rotten Tomatoes' : "NA"}, inplace = True)
# Directors
# df_tvshows = df_tvshows.drop(['Directors'], axis = 1)
df_tvshows.fillna({'Directors' : "NA"}, inplace = True)
# Cast
df_tvshows.fillna({'Cast' : "NA"}, inplace = True)
# Genres
df_tvshows.fillna({'Genres': "NA"}, inplace = True)
# Country
df_tvshows.fillna({'Country': "NA"}, inplace = True)
# Language
df_tvshows.fillna({'Language': "NA"}, inplace = True)
# Plotline
df_tvshows.fillna({'Plotline': "NA"}, inplace = True)
# Runtime
# df_tvshows.fillna({'Runtime' : df_tvshows['Runtime'].mean()}, inplace = True)
# df_tvshows['Runtime'] = df_tvshows['Runtime'].astype(int)
df_tvshows.fillna({'Runtime' : "NA"}, inplace = True)
# Kind
# df_tvshows.fillna({'Kind': "NA"}, inplace = True)
# Type
# df_tvshows.fillna({'Type': "NA"}, inplace = True)
# df_tvshows = df_tvshows.drop(['Type'], axis = 1)
# Seasons
# df_tvshows.fillna({'Seasons': 1}, inplace = True)
df_tvshows.fillna({'Seasons': "NA"}, inplace = True)
# df_tvshows = df_tvshows.drop(['Seasons'], axis = 1)
# df_tvshows['Seasons'] = df_tvshows['Seasons'].astype(int)
# df_tvshows.fillna({'Seasons' : df_tvshows['Seasons'].mean()}, inplace = True)
# df_tvshows['Seasons'] = df_tvshows['Seasons'].astype(int)
# Service Provider
df_tvshows['Service Provider'] = df_tvshows.loc[:, ['Netflix', 'Prime Video', 'Disney+', 'Hulu']].idxmax(axis = 1)
# df_tvshows.drop(['Netflix','Prime Video','Disney+','Hulu'], axis = 1)
# Removing Duplicate and Missing Entries
df_tvshows.dropna(how = 'any', inplace = True)
df_tvshows.drop_duplicates(inplace = True)
data_investigate(df_tvshows)
No of Rows : 5432
No of Coloums : 21
**************************************************
Colums Names :
Index(['ID', 'Title', 'Year', 'Age', 'IMDb', 'Rotten Tomatoes', 'Directors',
'Cast', 'Genres', 'Country', 'Language', 'Plotline', 'Runtime', 'Kind',
'Seasons', 'Netflix', 'Hulu', 'Prime Video', 'Disney+', 'Type',
'Service Provider'],
dtype='object')
**************************************************
Datatype of Columns :
ID int64
Title object
Year int64
Age object
IMDb object
Rotten Tomatoes object
Directors object
Cast object
Genres object
Country object
Language object
Plotline object
Runtime object
Kind object
Seasons object
Netflix int64
Hulu int64
Prime Video int64
Disney+ int64
Type int64
Service Provider object
dtype: object
**************************************************
Missing Values :
Series([], dtype: int64)
**************************************************
Missing vaules %age wise :
ID 0.0
Title 0.0
Year 0.0
Age 0.0
IMDb 0.0
Rotten Tomatoes 0.0
Directors 0.0
Cast 0.0
Genres 0.0
Country 0.0
Language 0.0
Plotline 0.0
Runtime 0.0
Kind 0.0
Seasons 0.0
Netflix 0.0
Hulu 0.0
Prime Video 0.0
Disney+ 0.0
Type 0.0
Service Provider 0.0
dtype: float64
**************************************************
Pictorial Representation :
df_tvshows.head()
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Plotline | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | Snowpiercer | 2013 | 18 | 6.9 | 94 | NA | Daveed Diggs,Iddo Goldberg,Mickey Sumner,Aliso... | Action,Drama,Sci-Fi,Thriller | United States | ... | Set seven years after the world has become a f... | 60 | tv series | 3 | 1 | 0 | 0 | 0 | 1 | Netflix |
| 1 | 2 | Philadelphia | 1993 | 13 | 8.8 | 80 | NA | Charlie Day,Glenn Howerton,Rob McElhenney,Kait... | Comedy | United States | ... | The gang, 5 raging alcoholic, narcissists run ... | 22 | tv series | 18 | 1 | 0 | 0 | 0 | 1 | Netflix |
| 2 | 3 | Roma | 2018 | 18 | 8.7 | 93 | NA | Kevin McKidd,Ray Stevenson,Polly Walker,Kerry ... | Action,Drama,History,Romance,War | United Kingdom,United States | ... | In this British historical drama, the turbulen... | 52 | tv series | 2 | 1 | 0 | 0 | 0 | 1 | Netflix |
| 3 | 4 | Amy | 2015 | 18 | 7 | 87 | NA | Amy Brenneman,Richard T. Jones,Jessica Tuck,Ma... | Drama | United States | ... | A family drama focused on three generations of... | 60 | tv series | 6 | 1 | 0 | 1 | 1 | 1 | Netflix |
| 4 | 5 | The Young Offenders | 2016 | NR | 8 | 100 | NA | Alex Murphy,Chris Walley,Hilary Rose,Dominic M... | Comedy | United Kingdom,Ireland | ... | NA | 30 | tv series | 3 | 1 | 0 | 0 | 0 | 1 | Netflix |
5 rows × 21 columns
df_tvshows.describe()
| ID | Year | Netflix | Hulu | Prime Video | Disney+ | Type | |
|---|---|---|---|---|---|---|---|
| count | 5432.000000 | 5432.000000 | 5432.000000 | 5432.000000 | 5432.000000 | 5432.000000 | 5432.0 |
| mean | 2716.500000 | 2010.668446 | 0.341311 | 0.293999 | 0.403351 | 0.033689 | 1.0 |
| std | 1568.227662 | 11.726176 | 0.474193 | 0.455633 | 0.490615 | 0.180445 | 0.0 |
| min | 1.000000 | 1901.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.0 |
| 25% | 1358.750000 | 2009.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.0 |
| 50% | 2716.500000 | 2014.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 1.0 |
| 75% | 4074.250000 | 2017.000000 | 1.000000 | 1.000000 | 1.000000 | 0.000000 | 1.0 |
| max | 5432.000000 | 2020.000000 | 1.000000 | 1.000000 | 1.000000 | 1.000000 | 1.0 |
df_tvshows.corr()
| ID | Year | Netflix | Hulu | Prime Video | Disney+ | Type | |
|---|---|---|---|---|---|---|---|
| ID | 1.000000 | -0.031346 | -0.646330 | 0.034293 | 0.441264 | 0.195409 | NaN |
| Year | -0.031346 | 1.000000 | 0.222316 | -0.065807 | -0.198675 | -0.022741 | NaN |
| Netflix | -0.646330 | 0.222316 | 1.000000 | -0.366515 | -0.515086 | -0.119344 | NaN |
| Hulu | 0.034293 | -0.065807 | -0.366515 | 1.000000 | -0.377374 | -0.075701 | NaN |
| Prime Video | 0.441264 | -0.198675 | -0.515086 | -0.377374 | 1.000000 | -0.151442 | NaN |
| Disney+ | 0.195409 | -0.022741 | -0.119344 | -0.075701 | -0.151442 | 1.000000 | NaN |
| Type | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
# df_tvshows.sort_values('Year', ascending = True)
# df_tvshows.sort_values('IMDb', ascending = False)
# df_tvshows.to_csv(path_or_buf= '/content/drive/MyDrive/Files/updated_otttvshows.csv', index = False)
# path = '/content/drive/MyDrive/Files/'
# udf_tvshows = pd.read_csv(path + 'updated_otttvshows.csv')
# udf_tvshows
# df_netflix_tvshows = df_tvshows.loc[(df_tvshows['Netflix'] > 0)]
# df_hulu_tvshows = df_tvshows.loc[(df_tvshows['Hulu'] > 0)]
# df_prime_video_tvshows = df_tvshows.loc[(df_tvshows['Prime Video'] > 0)]
# df_disney_tvshows = df_tvshows.loc[(df_tvshows['Disney+'] > 0)]
df_netflix_only_tvshows = df_tvshows[(df_tvshows['Netflix'] == 1) & (df_tvshows['Hulu'] == 0) & (df_tvshows['Prime Video'] == 0 ) & (df_tvshows['Disney+'] == 0)]
df_hulu_only_tvshows = df_tvshows[(df_tvshows['Netflix'] == 0) & (df_tvshows['Hulu'] == 1) & (df_tvshows['Prime Video'] == 0 ) & (df_tvshows['Disney+'] == 0)]
df_prime_video_only_tvshows = df_tvshows[(df_tvshows['Netflix'] == 0) & (df_tvshows['Hulu'] == 0) & (df_tvshows['Prime Video'] == 1 ) & (df_tvshows['Disney+'] == 0)]
df_disney_only_tvshows = df_tvshows[(df_tvshows['Netflix'] == 0) & (df_tvshows['Hulu'] == 0) & (df_tvshows['Prime Video'] == 0 ) & (df_tvshows['Disney+'] == 1)]
df_tvshows_languages = df_tvshows.copy()
df_tvshows_languages.drop(df_tvshows_languages.loc[df_tvshows_languages['Language'] == "NA"].index, inplace = True)
# df_tvshows_languages = df_tvshows_languages[df_tvshows_languages.Language != "NA"]
# df_tvshows_languages['Language'] = df_tvshows_languages['Language'].astype(str)
df_tvshows_count_languages = df_tvshows_languages.copy()
df_tvshows_language = df_tvshows_languages.copy()
# Create languages dict where key=name and value = number of languages
languages = {}
for i in df_tvshows_count_languages['Language'].dropna():
if i != "NA":
#print(i,len(i.split(',')))
languages[i] = len(i.split(','))
else:
languages[i] = 0
# Add this information to our dataframe as a new column
df_tvshows_count_languages['Number of Languages'] = df_tvshows_count_languages['Language'].map(languages).astype(int)
df_tvshows_mixed_languages = df_tvshows_count_languages.copy()
# Creating distinct dataframes only with the tvshows present on individual streaming platforms
netflix_languages_tvshows = df_tvshows_count_languages.loc[df_tvshows_count_languages['Netflix'] == 1]
hulu_languages_tvshows = df_tvshows_count_languages.loc[df_tvshows_count_languages['Hulu'] == 1]
prime_video_languages_tvshows = df_tvshows_count_languages.loc[df_tvshows_count_languages['Prime Video'] == 1]
disney_languages_tvshows = df_tvshows_count_languages.loc[df_tvshows_count_languages['Disney+'] == 1]
plt.figure(figsize = (10, 10))
corr = df_tvshows_count_languages.corr()
# Plot figsize
fig, ax = plt.subplots(figsize=(10, 8))
# Generate Heat Map, alleast annotations and place floats in map
sns.heatmap(corr, cmap = 'magma', annot = True, fmt = ".2f")
# Apply xticks
plt.xticks(range(len(corr.columns)), corr.columns);
# Apply yticks
plt.yticks(range(len(corr.columns)), corr.columns)
# show plot
plt.show()
fig.show()
<Figure size 720x720 with 0 Axes>
df_languages_most_tvshows = df_tvshows_count_languages.sort_values(by = 'Number of Languages', ascending = False).reset_index()
df_languages_most_tvshows = df_languages_most_tvshows.drop(['index'], axis = 1)
# filter = (df_tvshows_count_languages['Number of Languages'] == (df_tvshows_count_languages['Number of Languages'].max()))
# df_languages_most_tvshows = df_tvshows_count_languages[filter]
# mostest_rated_tvshows = df_tvshows_count_languages.loc[df_tvshows_count_languages['Number of Languages'].idxmax()]
print('\nTV Shows with Highest Ever Number of Languages are : \n')
df_languages_most_tvshows.head(5)
TV Shows with Highest Ever Number of Languages are :
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | Number of Languages | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2262 | The Simpsons | 1989 | 16 | 8.6 | 85 | NA | Dan Castellaneta,Nancy Cartwright,Harry Sheare... | Animation,Comedy | United States | ... | 22 | tv series | 34 | 0 | 1 | 0 | 1 | 1 | Disney+ | 20 |
| 1 | 1680 | Legend Quest | 2017 | 7 | 7.4 | NA | NA | Johnny Rose,Annemarie Blanco,Oscar Cheda,Paul ... | Animation,Adventure,Comedy,Fantasy,Mystery | Mexico | ... | NA | tv series | 1 | 1 | 0 | 0 | 0 | 1 | Netflix | 18 |
| 2 | 5302 | One Strange Rock | 2018 | 7 | 8.8 | 83 | NA | Will Smith,Chris Hadfield,Jerry Linenger,Mae C... | Documentary | United States | ... | 47 | tv series | 2 | 0 | 0 | 0 | 1 | 1 | Disney+ | 16 |
| 3 | 921 | Clannad | 2007 | 7 | 7.9 | NA | NA | Yûichi Nakamura,David Matranga,Mai Nakahara,Lu... | Animation,Comedy,Drama,Fantasy,Romance | Japan | ... | 30 | tv series | 1 | 1 | 1 | 0 | 0 | 1 | Netflix | 14 |
| 4 | 2293 | Elementary | 2012 | 16 | 7.9 | 95 | NA | Jonny Lee Miller,Lucy Liu,Aidan Quinn,Jon Mich... | Crime,Drama,Mystery | United States | ... | 60 | tv series | 7 | 0 | 1 | 0 | 0 | 1 | Hulu | 12 |
5 rows × 22 columns
fig = px.bar(y = df_languages_most_tvshows['Title'][:15],
x = df_languages_most_tvshows['Number of Languages'][:15],
color = df_languages_most_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Highest Number of Languages : All Platforms')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
df_languages_least_tvshows = df_tvshows_count_languages.sort_values(by = 'Number of Languages', ascending = True).reset_index()
df_languages_least_tvshows = df_languages_least_tvshows.drop(['index'], axis = 1)
# filter = (df_tvshows_count_languages['Number of Languages'] == (df_tvshows_count_languages['Number of Languages'].min()))
# df_languages_least_tvshows = df_tvshows_count_languages[filter]
print('\nTV Shows with Lowest Ever Number of Languages are : \n')
df_languages_least_tvshows.head(5)
TV Shows with Lowest Ever Number of Languages are :
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | Number of Languages | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | Snowpiercer | 2013 | 18 | 6.9 | 94 | NA | Daveed Diggs,Iddo Goldberg,Mickey Sumner,Aliso... | Action,Drama,Sci-Fi,Thriller | United States | ... | 60 | tv series | 3 | 1 | 0 | 0 | 0 | 1 | Netflix | 1 |
| 1 | 3447 | Cultureshock | 2018 | 16 | 6.9 | NA | NA | Judd Apatow,Steve Bannos,Hannibal Buress,Linda... | Documentary | United States | ... | 60 | tv series | 1 | 0 | 1 | 0 | 0 | 1 | Hulu | 1 |
| 2 | 3446 | Finding Escobar's Millions | 2017 | 16 | 3.9 | NA | NA | Douglas Laux,Ben Smith,Ben Smith,Chris Feistl,... | Documentary | United States | ... | 41 | tv series | 2 | 0 | 1 | 0 | 0 | 1 | Hulu | 1 |
| 3 | 3445 | New York Goes to Work | 2009 | NR | 5.2 | NA | NA | Tiffany Pollard,David Fortier,Bryan Jones,Jack... | NA | United States | ... | NA | tv series | 1 | 0 | 1 | 1 | 0 | 1 | Prime Video | 1 |
| 4 | 3443 | Iconic Characters | 2018 | NR | 6.8 | NA | NA | Will Arnett,Hank Azaria,Jason Bateman,Paul Bet... | Talk-Show | United States | ... | 15 | tv series | NA | 0 | 1 | 1 | 0 | 1 | Prime Video | 1 |
5 rows × 22 columns
fig = px.bar(y = df_languages_least_tvshows['Title'][:15],
x = df_languages_least_tvshows['Number of Languages'][:15],
color = df_languages_least_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Lowest Number of Languages : All Platforms')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
print(f'''
Total '{df_tvshows_count_languages['Number of Languages'].unique().shape[0]}' unique Number of Languages s were Given, They were Like this,\n
{df_tvshows_count_languages.sort_values(by = 'Number of Languages', ascending = False)['Number of Languages'].unique()}\n
The Highest Number of Languages Ever Any TV Show Got is '{df_languages_most_tvshows['Title'][0]}' : '{df_languages_most_tvshows['Number of Languages'].max()}'\n
The Lowest Number of Languages Ever Any TV Show Got is '{df_languages_least_tvshows['Title'][0]}' : '{df_languages_least_tvshows['Number of Languages'].min()}'\n
''')
Total '16' unique Number of Languages s were Given, They were Like this,
[20 18 16 14 12 11 10 9 8 7 6 5 4 3 2 1]
The Highest Number of Languages Ever Any TV Show Got is 'The Simpsons' : '20'
The Lowest Number of Languages Ever Any TV Show Got is 'Snowpiercer' : '1'
netflix_languages_most_tvshows = df_languages_most_tvshows.loc[df_languages_most_tvshows['Netflix']==1].reset_index()
netflix_languages_most_tvshows = netflix_languages_most_tvshows.drop(['index'], axis = 1)
netflix_languages_least_tvshows = df_languages_least_tvshows.loc[df_languages_least_tvshows['Netflix']==1].reset_index()
netflix_languages_least_tvshows = netflix_languages_least_tvshows.drop(['index'], axis = 1)
netflix_languages_most_tvshows.head(5)
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | Number of Languages | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1680 | Legend Quest | 2017 | 7 | 7.4 | NA | NA | Johnny Rose,Annemarie Blanco,Oscar Cheda,Paul ... | Animation,Adventure,Comedy,Fantasy,Mystery | Mexico | ... | NA | tv series | 1 | 1 | 0 | 0 | 0 | 1 | Netflix | 18 |
| 1 | 921 | Clannad | 2007 | 7 | 7.9 | NA | NA | Yûichi Nakamura,David Matranga,Mai Nakahara,Lu... | Animation,Comedy,Drama,Fantasy,Romance | Japan | ... | 30 | tv series | 1 | 1 | 1 | 0 | 0 | 1 | Netflix | 14 |
| 2 | 661 | Into the Night | 2020 | 18 | 7.1 | 88 | NA | Pauline Etienne,Laurent Capelluto,Mehmet Kurtu... | Drama,Sci-Fi,Thriller | Belgium | ... | NA | tv series | 2 | 1 | 0 | 0 | 0 | 1 | Netflix | 10 |
| 3 | 670 | Marco Polo | 2014 | 18 | 8 | 66 | NA | Lorenzo Richelmy,Benedict Wong,Joan Chen,Remy ... | Adventure,Drama,History | United States | ... | 60 | tv series | 2 | 1 | 0 | 0 | 0 | 1 | Netflix | 8 |
| 4 | 988 | Queen Sono | 2020 | 18 | 6 | 91 | NA | Pearl Thusi,Vuyo Dabula,Sechaba Morojele,Chi M... | Action,Crime,Drama,Thriller | South Africa | ... | 43 | tv series | 2 | 1 | 0 | 0 | 0 | 1 | Netflix | 8 |
5 rows × 22 columns
fig = px.bar(y = netflix_languages_most_tvshows['Title'][:15],
x = netflix_languages_most_tvshows['Number of Languages'][:15],
color = netflix_languages_most_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Highest Number of Languages : Netflix')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
fig = px.bar(y = netflix_languages_least_tvshows['Title'][:15],
x = netflix_languages_least_tvshows['Number of Languages'][:15],
color = netflix_languages_least_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Lowest Number of Languages : Netflix')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
hulu_languages_most_tvshows = df_languages_most_tvshows.loc[df_languages_most_tvshows['Hulu']==1].reset_index()
hulu_languages_most_tvshows = hulu_languages_most_tvshows.drop(['index'], axis = 1)
hulu_languages_least_tvshows = df_languages_least_tvshows.loc[df_languages_least_tvshows['Hulu']==1].reset_index()
hulu_languages_least_tvshows = hulu_languages_least_tvshows.drop(['index'], axis = 1)
hulu_languages_most_tvshows.head(5)
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | Number of Languages | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2262 | The Simpsons | 1989 | 16 | 8.6 | 85 | NA | Dan Castellaneta,Nancy Cartwright,Harry Sheare... | Animation,Comedy | United States | ... | 22 | tv series | 34 | 0 | 1 | 0 | 1 | 1 | Disney+ | 20 |
| 1 | 921 | Clannad | 2007 | 7 | 7.9 | NA | NA | Yûichi Nakamura,David Matranga,Mai Nakahara,Lu... | Animation,Comedy,Drama,Fantasy,Romance | Japan | ... | 30 | tv series | 1 | 1 | 1 | 0 | 0 | 1 | Netflix | 14 |
| 2 | 2293 | Elementary | 2012 | 16 | 7.9 | 95 | NA | Jonny Lee Miller,Lucy Liu,Aidan Quinn,Jon Mich... | Crime,Drama,Mystery | United States | ... | 60 | tv series | 7 | 0 | 1 | 0 | 0 | 1 | Hulu | 12 |
| 3 | 2341 | The Last Ship | 2014 | 16 | 7.5 | 83 | NA | Eric Dane,Adam Baldwin,Charles Parnell,Travis ... | Action,Drama,Sci-Fi,Thriller,War | United States | ... | 60 | tv series | 5 | 0 | 1 | 0 | 0 | 1 | Hulu | 11 |
| 4 | 2263 | Lost | 2004 | 16 | 8.3 | 85 | NA | Jorge Garcia,Josh Holloway,Yunjin Kim,Evangeli... | Adventure,Drama,Fantasy,Mystery,Sci-Fi,Thriller | United States | ... | 44 | tv series | 6 | 0 | 1 | 0 | 0 | 1 | Hulu | 10 |
5 rows × 22 columns
fig = px.bar(y = hulu_languages_most_tvshows['Title'][:15],
x = hulu_languages_most_tvshows['Number of Languages'][:15],
color = hulu_languages_most_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Highest Number of Languages : Hulu')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
fig = px.bar(y = hulu_languages_least_tvshows['Title'][:15],
x = hulu_languages_least_tvshows['Number of Languages'][:15],
color = hulu_languages_least_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Lowest Number of Languages : Hulu')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
prime_video_languages_most_tvshows = df_languages_most_tvshows.loc[df_languages_most_tvshows['Prime Video']==1].reset_index()
prime_video_languages_most_tvshows = prime_video_languages_most_tvshows.drop(['index'], axis = 1)
prime_video_languages_least_tvshows = df_languages_least_tvshows.loc[df_languages_least_tvshows['Prime Video']==1].reset_index()
prime_video_languages_least_tvshows = prime_video_languages_least_tvshows.drop(['index'], axis = 1)
prime_video_languages_most_tvshows.head(5)
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | Number of Languages | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2260 | Vikings | 2013 | 18 | 8.5 | 93 | NA | Katheryn Winnick,Gustaf Skarsgård,Alexander Lu... | Action,Adventure,Drama,History,Romance,War | Ireland,Canada | ... | 44 | tv series | 6 | 0 | 1 | 1 | 0 | 1 | Prime Video | 10 |
| 1 | 346 | 24 Hours | 2014 | NR | 8.3 | 86 | NA | Kiefer Sutherland,Mary Lynn Rajskub,Carlos Ber... | Action,Crime,Drama,Thriller | United States | ... | 44 | tv series | 8 | 0 | 0 | 1 | 0 | 1 | Prime Video | 8 |
| 2 | 364 | Carlos el terrorista | 1980 | NR | 7.6 | NA | NA | Edgar Ramírez,Alexander Scheer,Fadi Abi Samra,... | Biography,Crime,Drama,Thriller | France,Germany | ... | 334 | tv series | 1 | 0 | 0 | 1 | 0 | 1 | Prime Video | 8 |
| 3 | 4410 | Marco Polo | 2007 | 18 | 8 | 66 | NA | Lorenzo Richelmy,Benedict Wong,Joan Chen,Remy ... | Adventure,Drama,History | United States | ... | 60 | tv series | 2 | 0 | 0 | 1 | 0 | 1 | Prime Video | 8 |
| 4 | 3743 | Tom Clancy's Jack Ryan | 2018 | 16 | 8.1 | 71 | NA | John Krasinski,Wendell Pierce,John Hoogenakker... | Action,Drama,Thriller | United States | ... | 60 | tv series | 3 | 0 | 0 | 1 | 0 | 1 | Prime Video | 8 |
5 rows × 22 columns
fig = px.bar(y = prime_video_languages_most_tvshows['Title'][:15],
x = prime_video_languages_most_tvshows['Number of Languages'][:15],
color = prime_video_languages_most_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Highest Number of Languages : Prime Video')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
fig = px.bar(y = prime_video_languages_least_tvshows['Title'][:15],
x = prime_video_languages_least_tvshows['Number of Languages'][:15],
color = prime_video_languages_least_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Lowest Number of Languages : Prime Video')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
disney_languages_most_tvshows = df_languages_most_tvshows.loc[df_languages_most_tvshows['Disney+']==1].reset_index()
disney_languages_most_tvshows = disney_languages_most_tvshows.drop(['index'], axis = 1)
disney_languages_least_tvshows = df_languages_least_tvshows.loc[df_languages_least_tvshows['Disney+']==1].reset_index()
disney_languages_least_tvshows = disney_languages_least_tvshows.drop(['index'], axis = 1)
disney_languages_most_tvshows.head(5)
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | Number of Languages | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2262 | The Simpsons | 1989 | 16 | 8.6 | 85 | NA | Dan Castellaneta,Nancy Cartwright,Harry Sheare... | Animation,Comedy | United States | ... | 22 | tv series | 34 | 0 | 1 | 0 | 1 | 1 | Disney+ | 20 |
| 1 | 5302 | One Strange Rock | 2018 | 7 | 8.8 | 83 | NA | Will Smith,Chris Hadfield,Jerry Linenger,Mae C... | Documentary | United States | ... | 47 | tv series | 2 | 0 | 0 | 0 | 1 | 1 | Disney+ | 16 |
| 2 | 5375 | My Friends Tigger & Pooh | 2007 | 0 | 5.8 | NA | NA | Angelica Bolognesi Bonacini,Jim Cummings,Chloë... | Animation,Short,Adventure,Family | United States | ... | 30 | tv series | 3 | 0 | 0 | 0 | 1 | 1 | Disney+ | 7 |
| 3 | 488 | Tangled: Before Ever After | 2017 | 0 | 7.7 | NA | NA | Mandy Moore,Zachary Levi,Eden Espinosa,Paul F.... | Animation,Action,Adventure,Comedy,Family,Fanta... | United States | ... | 21 | tv series | 3 | 0 | 0 | 0 | 1 | 1 | Disney+ | 3 |
| 4 | 5324 | Rapunzel's Tangled Adventure | 2017 | 7 | 7.7 | NA | NA | Mandy Moore,Zachary Levi,Eden Espinosa,Paul F.... | Animation,Action,Adventure,Comedy,Family,Fanta... | United States | ... | 21 | tv series | 3 | 0 | 0 | 0 | 1 | 1 | Disney+ | 3 |
5 rows × 22 columns
fig = px.bar(y = disney_languages_most_tvshows['Title'][:15],
x = disney_languages_most_tvshows['Number of Languages'][:15],
color = disney_languages_most_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Highest Number of Languages : Disney+')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
fig = px.bar(y = disney_languages_least_tvshows['Title'][:15],
x = disney_languages_least_tvshows['Number of Languages'][:15],
color = disney_languages_least_tvshows['Number of Languages'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Languages'},
title = 'TV Shows with Lowest Number of Languages : Disney+')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
print(f'''
The TV Show with Highest Number of Languages Ever Got is '{df_languages_most_tvshows['Title'][0]}' : '{df_languages_most_tvshows['Number of Languages'].max()}'\n
The TV Show with Lowest Number of Languages Ever Got is '{df_languages_least_tvshows['Title'][0]}' : '{df_languages_least_tvshows['Number of Languages'].min()}'\n
The TV Show with Highest Number of Languages on 'Netflix' is '{netflix_languages_most_tvshows['Title'][0]}' : '{netflix_languages_most_tvshows['Number of Languages'].max()}'\n
The TV Show with Lowest Number of Languages on 'Netflix' is '{netflix_languages_least_tvshows['Title'][0]}' : '{netflix_languages_least_tvshows['Number of Languages'].min()}'\n
The TV Show with Highest Number of Languages on 'Hulu' is '{hulu_languages_most_tvshows['Title'][0]}' : '{hulu_languages_most_tvshows['Number of Languages'].max()}'\n
The TV Show with Lowest Number of Languages on 'Hulu' is '{hulu_languages_least_tvshows['Title'][0]}' : '{hulu_languages_least_tvshows['Number of Languages'].min()}'\n
The TV Show with Highest Number of Languages on 'Prime Video' is '{prime_video_languages_most_tvshows['Title'][0]}' : '{prime_video_languages_most_tvshows['Number of Languages'].max()}'\n
The TV Show with Lowest Number of Languages on 'Prime Video' is '{prime_video_languages_least_tvshows['Title'][0]}' : '{prime_video_languages_least_tvshows['Number of Languages'].min()}'\n
The TV Show with Highest Number of Languages on 'Disney+' is '{disney_languages_most_tvshows['Title'][0]}' : '{disney_languages_most_tvshows['Number of Languages'].max()}'\n
The TV Show with Lowest Number of Languages on 'Disney+' is '{disney_languages_least_tvshows['Title'][0]}' : '{disney_languages_least_tvshows['Number of Languages'].min()}'\n
''')
The TV Show with Highest Number of Languages Ever Got is 'The Simpsons' : '20'
The TV Show with Lowest Number of Languages Ever Got is 'Snowpiercer' : '1'
The TV Show with Highest Number of Languages on 'Netflix' is 'Legend Quest' : '18'
The TV Show with Lowest Number of Languages on 'Netflix' is 'Snowpiercer' : '1'
The TV Show with Highest Number of Languages on 'Hulu' is 'The Simpsons' : '20'
The TV Show with Lowest Number of Languages on 'Hulu' is 'Cultureshock' : '1'
The TV Show with Highest Number of Languages on 'Prime Video' is 'Vikings' : '10'
The TV Show with Lowest Number of Languages on 'Prime Video' is 'New York Goes to Work' : '1'
The TV Show with Highest Number of Languages on 'Disney+' is 'The Simpsons' : '20'
The TV Show with Lowest Number of Languages on 'Disney+' is 'Lost Treasures of Egypt' : '1'
print(f'''
Accross All Platforms the Average Number of Languages is '{round(df_tvshows_count_languages['Number of Languages'].mean(), ndigits = 2)}'\n
The Average Number of Languages on 'Netflix' is '{round(netflix_languages_tvshows['Number of Languages'].mean(), ndigits = 2)}'\n
The Average Number of Languages on 'Hulu' is '{round(hulu_languages_tvshows['Number of Languages'].mean(), ndigits = 2)}'\n
The Average Number of Languages on 'Prime Video' is '{round(prime_video_languages_tvshows['Number of Languages'].mean(), ndigits = 2)}'\n
The Average Number of Languages on 'Disney+' is '{round(disney_languages_tvshows['Number of Languages'].mean(), ndigits = 2)}'\n
''')
Accross All Platforms the Average Number of Languages is '1.2'
The Average Number of Languages on 'Netflix' is '1.24'
The Average Number of Languages on 'Hulu' is '1.23'
The Average Number of Languages on 'Prime Video' is '1.16'
The Average Number of Languages on 'Disney+' is '1.34'
print(f'''
Accross All Platforms Total Count of Language is '{df_tvshows_count_languages['Number of Languages'].max()}'\n
Total Count of Language on 'Netflix' is '{netflix_languages_tvshows['Number of Languages'].max()}'\n
Total Count of Language on 'Hulu' is '{hulu_languages_tvshows['Number of Languages'].max()}'\n
Total Count of Language on 'Prime Video' is '{prime_video_languages_tvshows['Number of Languages'].max()}'\n
Total Count of Language on 'Disney+' is '{disney_languages_tvshows['Number of Languages'].max()}'\n
''')
Accross All Platforms Total Count of Language is '20'
Total Count of Language on 'Netflix' is '18'
Total Count of Language on 'Hulu' is '20'
Total Count of Language on 'Prime Video' is '10'
Total Count of Language on 'Disney+' is '20'
f, ax = plt.subplots(1, 2 , figsize = (20, 5))
sns.distplot(df_tvshows_count_languages['Number of Languages'],bins = 20, kde = True, ax = ax[0])
sns.boxplot(df_tvshows_count_languages['Number of Languages'], ax = ax[1])
plt.show()
# Defining plot size and title
plt.figure(figsize = (20, 5))
plt.title('Number of Languages s Per Platform')
# Plotting the information from each dataset into a histogram
sns.histplot(prime_video_languages_tvshows['Number of Languages'], color = 'lightblue', legend = True, kde = True)
sns.histplot(netflix_languages_tvshows['Number of Languages'], color = 'red', legend = True, kde = True)
sns.histplot(hulu_languages_tvshows['Number of Languages'], color = 'lightgreen', legend = True, kde = True)
sns.histplot(disney_languages_tvshows['Number of Languages'], color = 'darkblue', legend = True, kde = True)
# Setting the legend
plt.legend(['Prime Video', 'Netflix', 'Hulu', 'Disney+'])
plt.show()
df_lan = df_tvshows_language['Language'].str.split(',').apply(pd.Series).stack()
del df_tvshows_language['Language']
df_lan.index = df_lan.index.droplevel(-1)
df_lan.name = 'Language'
df_tvshows_language = df_tvshows_language.join(df_lan)
df_tvshows_language.drop_duplicates(inplace = True)
df_tvshows_language.head(5)
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | Language | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | Snowpiercer | 2013 | 18 | 6.9 | 94 | NA | Daveed Diggs,Iddo Goldberg,Mickey Sumner,Aliso... | Action,Drama,Sci-Fi,Thriller | United States | ... | 60 | tv series | 3 | 1 | 0 | 0 | 0 | 1 | Netflix | English |
| 1 | 2 | Philadelphia | 1993 | 13 | 8.8 | 80 | NA | Charlie Day,Glenn Howerton,Rob McElhenney,Kait... | Comedy | United States | ... | 22 | tv series | 18 | 1 | 0 | 0 | 0 | 1 | Netflix | English |
| 2 | 3 | Roma | 2018 | 18 | 8.7 | 93 | NA | Kevin McKidd,Ray Stevenson,Polly Walker,Kerry ... | Action,Drama,History,Romance,War | United Kingdom,United States | ... | 52 | tv series | 2 | 1 | 0 | 0 | 0 | 1 | Netflix | English |
| 3 | 4 | Amy | 2015 | 18 | 7 | 87 | NA | Amy Brenneman,Richard T. Jones,Jessica Tuck,Ma... | Drama | United States | ... | 60 | tv series | 6 | 1 | 0 | 1 | 1 | 1 | Netflix | English |
| 4 | 5 | The Young Offenders | 2016 | NR | 8 | 100 | NA | Alex Murphy,Chris Walley,Hilary Rose,Dominic M... | Comedy | United Kingdom,Ireland | ... | 30 | tv series | 3 | 1 | 0 | 0 | 0 | 1 | Netflix | English |
5 rows × 21 columns
language_count = df_tvshows_language.groupby('Language')['Title'].count()
language_tvshows = df_tvshows_language.groupby('Language')[['Netflix', 'Hulu', 'Prime Video', 'Disney+']].sum()
language_data_tvshows = pd.concat([language_count, language_tvshows], axis = 1).reset_index().rename(columns = {'Title' : 'TV Shows Count'})
language_data_tvshows = language_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)
# Language with TV Shows Counts - All Platforms Combined
language_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)[:10]
| Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 28 | English | 3876 | 1177 | 1271 | 1575 | 166 |
| 46 | Japanese | 402 | 142 | 224 | 95 | 4 |
| 82 | Spanish | 268 | 151 | 76 | 49 | 8 |
| 33 | French | 159 | 75 | 34 | 61 | 5 |
| 50 | Korean | 156 | 106 | 26 | 37 | 3 |
| 35 | German | 92 | 34 | 17 | 37 | 6 |
| 58 | Mandarin | 90 | 68 | 10 | 14 | 1 |
| 75 | Russian | 80 | 32 | 17 | 36 | 2 |
| 8 | Arabic | 62 | 31 | 16 | 17 | 2 |
| 45 | Italian | 57 | 32 | 12 | 16 | 2 |
fig = px.bar(x = language_data_tvshows['Language'][:50],
y = language_data_tvshows['TV Shows Count'][:50],
color = language_data_tvshows['TV Shows Count'][:50],
color_continuous_scale = 'Teal_r',
labels = { 'x' : 'Language', 'y' : 'TV Shows Count'},
title = 'Major Languages : All Platforms')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
df_language_high_tvshows = language_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False).reset_index()
df_language_high_tvshows = df_language_high_tvshows.drop(['index'], axis = 1)
# filter = (language_data_tvshows['TV Shows Count'] == (language_data_tvshows['TV Shows Count'].max()))
# df_language_high_tvshows = language_data_tvshows[filter]
# highest_rated_tvshows = language_data_tvshows.loc[language_data_tvshows['TV Shows Count'].idxmax()]
print('\nLanguage with Highest Ever TV Shows Count are : All Platforms Combined\n')
df_language_high_tvshows.head(5)
Language with Highest Ever TV Shows Count are : All Platforms Combined
| Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | English | 3876 | 1177 | 1271 | 1575 | 166 |
| 1 | Japanese | 402 | 142 | 224 | 95 | 4 |
| 2 | Spanish | 268 | 151 | 76 | 49 | 8 |
| 3 | French | 159 | 75 | 34 | 61 | 5 |
| 4 | Korean | 156 | 106 | 26 | 37 | 3 |
fig = px.bar(y = df_language_high_tvshows['Language'][:15],
x = df_language_high_tvshows['TV Shows Count'][:15],
color = df_language_high_tvshows['TV Shows Count'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'Language', 'x' : 'TV Shows Count'},
title = 'Language with Highest TV Shows : All Platforms')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
df_language_low_tvshows = language_data_tvshows.sort_values(by = 'TV Shows Count', ascending = True).reset_index()
df_language_low_tvshows = df_language_low_tvshows.drop(['index'], axis = 1)
# filter = (language_data_tvshows['TV Shows Count'] == (language_data_tvshows['TV Shows Count'].min()))
# df_language_low_tvshows = language_data_tvshows[filter]
print('\nLanguage with Lowest Ever TV Shows Count are : All Platforms Combined\n')
df_language_low_tvshows.head(5)
Language with Lowest Ever TV Shows Count are : All Platforms Combined
| Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | Ancient (to 1453) | 1 | 0 | 1 | 1 | 0 |
| 1 | Abkhazian | 1 | 0 | 0 | 0 | 1 |
| 2 | Wolof | 1 | 0 | 0 | 1 | 0 |
| 3 | Amharic | 1 | 1 | 0 | 0 | 0 |
| 4 | Aramaic | 1 | 0 | 0 | 1 | 0 |
fig = px.bar(y = df_language_low_tvshows['Language'][:15],
x = df_language_low_tvshows['TV Shows Count'][:15],
color = df_language_low_tvshows['TV Shows Count'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'Language', 'x' : 'TV Shows Count'},
title = 'Language with Lowest TV Shows Count : All Platforms')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
print(f'''
Total '{language_data_tvshows['Language'].unique().shape[0]}' unique Language Count s were Given, They were Like this,\n
{language_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)['Language'].unique()[:5]}\n
The Highest Ever TV Shows Count Ever Any TV Show Got is '{df_language_high_tvshows['Language'][0]}' : '{df_language_high_tvshows['TV Shows Count'].max()}'\n
The Lowest Ever TV Shows Count Ever Any TV Show Got is '{df_language_low_tvshows['Language'][0]}' : '{df_language_low_tvshows['TV Shows Count'].min()}'\n
''')
Total '101' unique Language Count s were Given, They were Like this,
['English' 'Japanese' 'Spanish' 'French' 'Korean']
The Highest Ever TV Shows Count Ever Any TV Show Got is 'English' : '3876'
The Lowest Ever TV Shows Count Ever Any TV Show Got is ' Ancient (to 1453)' : '1'
fig = px.pie(language_data_tvshows[:10], names = 'Language', values = 'TV Shows Count', color_discrete_sequence = px.colors.sequential.Teal)
fig.update_traces(textposition = 'inside', textinfo = 'percent+label', title = 'TV Shows Count based on Language')
fig.show()
# netflix_language_tvshows = language_data_tvshows[language_data_tvshows['Netflix'] != 0].sort_values(by = 'Netflix', ascending = False).reset_index()
# netflix_language_tvshows = netflix_language_tvshows.drop(['index', 'Hulu', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
netflix_language_high_tvshows = df_language_high_tvshows.sort_values(by = 'Netflix', ascending = False).reset_index()
netflix_language_high_tvshows = netflix_language_high_tvshows.drop(['index'], axis = 1)
netflix_language_low_tvshows = df_language_high_tvshows.sort_values(by = 'Netflix', ascending = True).reset_index()
netflix_language_low_tvshows = netflix_language_low_tvshows.drop(['index'], axis = 1)
netflix_language_high_tvshows.head(5)
| Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | English | 3876 | 1177 | 1271 | 1575 | 166 |
| 1 | Spanish | 268 | 151 | 76 | 49 | 8 |
| 2 | Japanese | 402 | 142 | 224 | 95 | 4 |
| 3 | Korean | 156 | 106 | 26 | 37 | 3 |
| 4 | French | 159 | 75 | 34 | 61 | 5 |
fig = px.bar(x = netflix_language_high_tvshows['Language'][:15],
y = netflix_language_high_tvshows['Netflix'][:15],
color = netflix_language_high_tvshows['Netflix'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'Language', 'x' : 'TV Shows Count'},
title = 'Language with Highest TV Shows : Netflix')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
# hulu_language_tvshows = language_data_tvshows[language_data_tvshows['Hulu'] != 0].sort_values(by = 'Hulu', ascending = False).reset_index()
# hulu_language_tvshows = hulu_language_tvshows.drop(['index', 'Netflix', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
hulu_language_high_tvshows = df_language_high_tvshows.sort_values(by = 'Hulu', ascending = False).reset_index()
hulu_language_high_tvshows = hulu_language_high_tvshows.drop(['index'], axis = 1)
hulu_language_low_tvshows = df_language_high_tvshows.sort_values(by = 'Hulu', ascending = True).reset_index()
hulu_language_low_tvshows = hulu_language_low_tvshows.drop(['index'], axis = 1)
hulu_language_high_tvshows.head(5)
| Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | English | 3876 | 1177 | 1271 | 1575 | 166 |
| 1 | Japanese | 402 | 142 | 224 | 95 | 4 |
| 2 | Spanish | 268 | 151 | 76 | 49 | 8 |
| 3 | French | 159 | 75 | 34 | 61 | 5 |
| 4 | Korean | 156 | 106 | 26 | 37 | 3 |
fig = px.bar(x = hulu_language_high_tvshows['Language'][:15],
y = hulu_language_high_tvshows['Hulu'][:15],
color = hulu_language_high_tvshows['Hulu'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'Language', 'x' : 'TV Shows Count'},
title = 'Language with Highest TV Shows : Hulu')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
# prime_video_language_tvshows = language_data_tvshows[language_data_tvshows['Prime Video'] != 0].sort_values(by = 'Prime Video', ascending = False).reset_index()
# prime_video_language_tvshows = prime_video_language_tvshows.drop(['index', 'Netflix', 'Hulu', 'Disney+', 'TV Shows Count'], axis = 1)
prime_video_language_high_tvshows = df_language_high_tvshows.sort_values(by = 'Prime Video', ascending = False).reset_index()
prime_video_language_high_tvshows = prime_video_language_high_tvshows.drop(['index'], axis = 1)
prime_video_language_low_tvshows = df_language_high_tvshows.sort_values(by = 'Prime Video', ascending = True).reset_index()
prime_video_language_low_tvshows = prime_video_language_low_tvshows.drop(['index'], axis = 1)
prime_video_language_high_tvshows.head(5)
| Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | English | 3876 | 1177 | 1271 | 1575 | 166 |
| 1 | Japanese | 402 | 142 | 224 | 95 | 4 |
| 2 | French | 159 | 75 | 34 | 61 | 5 |
| 3 | Spanish | 268 | 151 | 76 | 49 | 8 |
| 4 | Korean | 156 | 106 | 26 | 37 | 3 |
fig = px.bar(x = prime_video_language_high_tvshows['Language'][:15],
y = prime_video_language_high_tvshows['Prime Video'][:15],
color = prime_video_language_high_tvshows['Prime Video'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'Language', 'x' : 'TV Shows Count'},
title = 'Language with Highest TV Shows : Prime Video')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
# disney_language_tvshows = language_data_tvshows[language_data_tvshows['Disney+'] != 0].sort_values(by = 'Disney+', ascending = False).reset_index()
# disney_language_tvshows = disney_language_tvshows.drop(['index', 'Netflix', 'Hulu', 'Prime Video', 'TV Shows Count'], axis = 1)
disney_language_high_tvshows = df_language_high_tvshows.sort_values(by = 'Disney+', ascending = False).reset_index()
disney_language_high_tvshows = disney_language_high_tvshows.drop(['index'], axis = 1)
disney_language_low_tvshows = df_language_high_tvshows.sort_values(by = 'Disney+', ascending = True).reset_index()
disney_language_low_tvshows = disney_language_low_tvshows.drop(['index'], axis = 1)
disney_language_high_tvshows.head(5)
| Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | English | 3876 | 1177 | 1271 | 1575 | 166 |
| 1 | Spanish | 268 | 151 | 76 | 49 | 8 |
| 2 | German | 92 | 34 | 17 | 37 | 6 |
| 3 | French | 159 | 75 | 34 | 61 | 5 |
| 4 | Japanese | 402 | 142 | 224 | 95 | 4 |
fig = px.bar(x = disney_language_high_tvshows['Language'][:15],
y = disney_language_high_tvshows['Disney+'][:15],
color = disney_language_high_tvshows['Disney+'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'Language', 'x' : 'TV Shows Count'},
title = 'Language with Highest TV Shows : Disney+')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
f, ax = plt.subplots(1, 2 , figsize = (20, 5))
sns.distplot(language_data_tvshows['TV Shows Count'], bins = 20, kde = True, ax = ax[0])
sns.boxplot(language_data_tvshows['TV Shows Count'], ax = ax[1])
plt.show()
# Creating distinct dataframes only with the tvshows present on individual streaming platforms
netflix_language_tvshows = language_data_tvshows[language_data_tvshows['Netflix'] != 0].sort_values(by = 'Netflix', ascending = False).reset_index()
netflix_language_tvshows = netflix_language_tvshows.drop(['index', 'Hulu', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
hulu_language_tvshows = language_data_tvshows[language_data_tvshows['Hulu'] != 0].sort_values(by = 'Hulu', ascending = False).reset_index()
hulu_language_tvshows = hulu_language_tvshows.drop(['index', 'Netflix', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
prime_video_language_tvshows = language_data_tvshows[language_data_tvshows['Prime Video'] != 0].sort_values(by = 'Prime Video', ascending = False).reset_index()
prime_video_language_tvshows = prime_video_language_tvshows.drop(['index', 'Netflix', 'Hulu', 'Disney+', 'TV Shows Count'], axis = 1)
disney_language_tvshows = language_data_tvshows[language_data_tvshows['Disney+'] != 0].sort_values(by = 'Disney+', ascending = False).reset_index()
disney_language_tvshows = disney_language_tvshows.drop(['index', 'Netflix', 'Hulu', 'Prime Video', 'TV Shows Count'], axis = 1)
# Defining plot size and title
plt.figure(figsize = (20, 5))
plt.title('Language TV Shows Count Per Platform')
# Plotting the information from each dataset into a histogram
sns.histplot(disney_language_tvshows['Disney+'][:50], color = 'darkblue', legend = True, kde = True)
sns.histplot(prime_video_language_tvshows['Prime Video'][:50], color = 'lightblue', legend = True, kde = True)
sns.histplot(netflix_language_tvshows['Netflix'][:50], color = 'red', legend = True, kde = True)
sns.histplot(hulu_language_tvshows['Hulu'][:50], color = 'lightgreen', legend = True, kde = True)
# Setting the legend
plt.legend(['Disney+', 'Prime Video', 'Netflix', 'Hulu'])
plt.show()
print(f'''
The Language with Highest TV Shows Count Ever Got is '{df_language_high_tvshows['Language'][0]}' : '{df_language_high_tvshows['TV Shows Count'].max()}'\n
The Language with Lowest TV Shows Count Ever Got is '{df_language_low_tvshows['Language'][0]}' : '{df_language_low_tvshows['TV Shows Count'].min()}'\n
The Language with Highest TV Shows Count on 'Netflix' is '{netflix_language_high_tvshows['Language'][0]}' : '{netflix_language_high_tvshows['Netflix'].max()}'\n
The Language with Lowest TV Shows Count on 'Netflix' is '{netflix_language_low_tvshows['Language'][0]}' : '{netflix_language_low_tvshows['Netflix'].min()}'\n
The Language with Highest TV Shows Count on 'Hulu' is '{hulu_language_high_tvshows['Language'][0]}' : '{hulu_language_high_tvshows['Hulu'].max()}'\n
The Language with Lowest TV Shows Count on 'Hulu' is '{hulu_language_low_tvshows['Language'][0]}' : '{hulu_language_low_tvshows['Hulu'].min()}'\n
The Language with Highest TV Shows Count on 'Prime Video' is '{prime_video_language_high_tvshows['Language'][0]}' : '{prime_video_language_high_tvshows['Prime Video'].max()}'\n
The Language with Lowest TV Shows Count on 'Prime Video' is '{prime_video_language_low_tvshows['Language'][0]}' : '{prime_video_language_low_tvshows['Prime Video'].min()}'\n
The Language with Highest TV Shows Count on 'Disney+' is '{disney_language_high_tvshows['Language'][0]}' : '{disney_language_high_tvshows['Disney+'].max()}'\n
The Language with Lowest TV Shows Count on 'Disney+' is '{disney_language_low_tvshows['Language'][0]}' : '{disney_language_low_tvshows['Disney+'].min()}'\n
''')
The Language with Highest TV Shows Count Ever Got is 'English' : '3876'
The Language with Lowest TV Shows Count Ever Got is ' Ancient (to 1453)' : '1'
The Language with Highest TV Shows Count on 'Netflix' is 'English' : '1177'
The Language with Lowest TV Shows Count on 'Netflix' is ' Ancient (to 1453)' : '0'
The Language with Highest TV Shows Count on 'Hulu' is 'English' : '1271'
The Language with Lowest TV Shows Count on 'Hulu' is 'Kurdish' : '0'
The Language with Highest TV Shows Count on 'Prime Video' is 'English' : '1575'
The Language with Lowest TV Shows Count on 'Prime Video' is 'Kazakh' : '0'
The Language with Highest TV Shows Count on 'Disney+' is 'English' : '166'
The Language with Lowest TV Shows Count on 'Disney+' is 'Scottish Gaelic' : '0'
# Distribution of tvshows language in each platform
plt.figure(figsize = (20, 5))
plt.title('Language with TV Shows Count for All Platforms')
sns.violinplot(x = language_data_tvshows['TV Shows Count'][:100], color = 'gold', legend = True, kde = True, shade = False)
plt.show()
# Distribution of Language TV Shows Count in each platform
f1, ax1 = plt.subplots(1, 2 , figsize = (20, 5))
sns.violinplot(x = netflix_language_tvshows['Netflix'][:100], color = 'red', ax = ax1[0])
sns.violinplot(x = hulu_language_tvshows['Hulu'][:100], color = 'lightgreen', ax = ax1[1])
f2, ax2 = plt.subplots(1, 2 , figsize = (20, 5))
sns.violinplot(x = prime_video_language_tvshows['Prime Video'][:100], color = 'lightblue', ax = ax2[0])
sns.violinplot(x = disney_language_tvshows['Disney+'][:100], color = 'darkblue', ax = ax2[1])
plt.show()
print(f'''
Accross All Platforms the Average TV Shows Count of Language is '{round(language_data_tvshows['TV Shows Count'].mean(), ndigits = 2)}'\n
The Average TV Shows Count of Language on 'Netflix' is '{round(netflix_language_tvshows['Netflix'].mean(), ndigits = 2)}'\n
The Average TV Shows Count of Language on 'Hulu' is '{round(hulu_language_tvshows['Hulu'].mean(), ndigits = 2)}'\n
The Average TV Shows Count of Language on 'Prime Video' is '{round(prime_video_language_tvshows['Prime Video'].mean(), ndigits = 2)}'\n
The Average TV Shows Count of Language on 'Disney+' is '{round(disney_language_tvshows['Disney+'].mean(), ndigits = 2)}'\n
''')
Accross All Platforms the Average TV Shows Count of Language is '57.03'
The Average TV Shows Count of Language on 'Netflix' is '28.95'
The Average TV Shows Count of Language on 'Hulu' is '31.33'
The Average TV Shows Count of Language on 'Prime Video' is '32.92'
The Average TV Shows Count of Language on 'Disney+' is '7.09'
print(f'''
Accross All Platforms Total Count of Language is '{language_data_tvshows['Language'].unique().shape[0]}'\n
Total Count of Language on 'Netflix' is '{netflix_language_tvshows['Language'].unique().shape[0]}'\n
Total Count of Language on 'Hulu' is '{hulu_language_tvshows['Language'].unique().shape[0]}'\n
Total Count of Language on 'Prime Video' is '{prime_video_language_tvshows['Language'].unique().shape[0]}'\n
Total Count of Language on 'Disney+' is '{disney_language_tvshows['Language'].unique().shape[0]}'\n
''')
Accross All Platforms Total Count of Language is '101'
Total Count of Language on 'Netflix' is '73'
Total Count of Language on 'Hulu' is '58'
Total Count of Language on 'Prime Video' is '64'
Total Count of Language on 'Disney+' is '32'
plt.figure(figsize = (20, 5))
sns.lineplot(x = language_data_tvshows['Language'][:10], y = language_data_tvshows['Netflix'][:10], color = 'red')
sns.lineplot(x = language_data_tvshows['Language'][:10], y = language_data_tvshows['Hulu'][:10], color = 'lightgreen')
sns.lineplot(x = language_data_tvshows['Language'][:10], y = language_data_tvshows['Prime Video'][:10], color = 'lightblue')
sns.lineplot(x = language_data_tvshows['Language'][:10], y = language_data_tvshows['Disney+'][:10], color = 'darkblue')
plt.xlabel('Language', fontsize = 20)
plt.ylabel('TV Shows Count', fontsize = 20)
plt.show()
fig, axes = plt.subplots(2, 2, figsize = (20 , 10))
n_l_ax1 = sns.lineplot(y = language_data_tvshows['Language'][:10], x = language_data_tvshows['Netflix'][:10], color = 'red', ax = axes[0, 0])
h_l_ax2 = sns.lineplot(y = language_data_tvshows['Language'][:10], x = language_data_tvshows['Hulu'][:10], color = 'lightgreen', ax = axes[0, 1])
p_l_ax3 = sns.lineplot(y = language_data_tvshows['Language'][:10], x = language_data_tvshows['Prime Video'][:10], color = 'lightblue', ax = axes[1, 0])
d_l_ax4 = sns.lineplot(y = language_data_tvshows['Language'][:10], x = language_data_tvshows['Disney+'][:10], color = 'darkblue', ax = axes[1, 1])
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
n_l_ax1.title.set_text(labels[0])
h_l_ax2.title.set_text(labels[1])
p_l_ax3.title.set_text(labels[2])
d_l_ax4.title.set_text(labels[3])
plt.show()
fig, axes = plt.subplots(2, 2, figsize = (20 , 20))
n_l_ax1 = sns.barplot(y = netflix_language_tvshows['Language'][:10], x = netflix_language_tvshows['Netflix'][:10], palette = 'Reds_r', ax = axes[0, 0])
h_l_ax2 = sns.barplot(y = hulu_language_tvshows['Language'][:10], x = hulu_language_tvshows['Hulu'][:10], palette = 'Greens_r', ax = axes[0, 1])
p_l_ax3 = sns.barplot(y = prime_video_language_tvshows['Language'][:10], x = prime_video_language_tvshows['Prime Video'][:10], palette = 'Blues_r', ax = axes[1, 0])
d_l_ax4 = sns.barplot(y = disney_language_tvshows['Language'][:10], x = disney_language_tvshows['Disney+'][:10], palette = 'BuPu_r', ax = axes[1, 1])
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
n_l_ax1.title.set_text(labels[0])
h_l_ax2.title.set_text(labels[1])
p_l_ax3.title.set_text(labels[2])
d_l_ax4.title.set_text(labels[3])
plt.show()
# Defining plot size and title
plt.figure(figsize = (20, 5))
plt.title('Language TV Shows Count Per Platform')
# Plotting the information from each dataset into a histogram
sns.kdeplot(netflix_language_tvshows['Netflix'][:10], color = 'red', legend = True)
sns.kdeplot(hulu_language_tvshows['Hulu'][:10], color = 'green', legend = True)
sns.kdeplot(prime_video_language_tvshows['Prime Video'][:10], color = 'lightblue', legend = True)
sns.kdeplot(disney_language_tvshows['Disney+'][:10], color = 'darkblue', legend = True)
# Setting the legend
plt.legend(['Netflix', 'Hulu', 'Prime Video', 'Disney+'])
plt.show()
fig, axes = plt.subplots(2, 2, figsize = (20 , 20))
n_l_ax1 = sns.barplot(y = language_data_tvshows['Language'][:10], x = language_data_tvshows['Netflix'][:10], palette = 'Reds_r', ax = axes[0, 0])
h_l_ax2 = sns.barplot(y = language_data_tvshows['Language'][:10], x = language_data_tvshows['Hulu'][:10], palette = 'Greens_r', ax = axes[0, 1])
p_l_ax3 = sns.barplot(y = language_data_tvshows['Language'][:10], x = language_data_tvshows['Prime Video'][:10], palette = 'Blues_r', ax = axes[1, 0])
d_l_ax4 = sns.barplot(y = language_data_tvshows['Language'][:10], x = language_data_tvshows['Disney+'][:10], palette = 'BuPu_r', ax = axes[1, 1])
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
n_l_ax1.title.set_text(labels[0])
h_l_ax2.title.set_text(labels[1])
p_l_ax3.title.set_text(labels[2])
d_l_ax4.title.set_text(labels[3])
plt.show()
df_tvshows_mixed_languages.drop(df_tvshows_mixed_languages.loc[df_tvshows_mixed_languages['Language'] == "NA"].index, inplace = True)
# df_tvshows_mixed_languages = df_tvshows_mixed_languages[df_tvshows_mixed_languages.Language != "NA"]
df_tvshows_mixed_languages.drop(df_tvshows_mixed_languages.loc[df_tvshows_mixed_languages['Number of Languages'] == 1].index, inplace = True)
df_tvshows_mixed_languages.head(5)
| ID | Title | Year | Age | IMDb | Rotten Tomatoes | Directors | Cast | Genres | Country | ... | Runtime | Kind | Seasons | Netflix | Hulu | Prime Video | Disney+ | Type | Service Provider | Number of Languages | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 16 | Eli | 2019 | 18 | 7.9 | 46 | NA | Sacha Baron Cohen,Hadar Ratzon Rotem,Yael Eita... | Drama,History | France | ... | 53 | tv series | 1 | 1 | 0 | 1 | 0 | 1 | Netflix | 2 |
| 28 | 29 | A Love Story | 2007 | NR | 6.1 | 74 | NA | Seçkin Özdemir,Damla Sönmez,Yamaç Telli,Elçin ... | Drama,Romance | Turkey | ... | 100 | tv series | 1 | 1 | 0 | 0 | 0 | 1 | Netflix | 2 |
| 40 | 41 | Heirs | 2015 | NR | 7.5 | 67 | NA | Lee Min-Ho,Park Shin-Hye,Woo-bin Kim,Kim Ji-Wo... | Comedy,Drama,Romance | South Korea | ... | 55 | tv series | 1 | 1 | 0 | 0 | 0 | 1 | Netflix | 2 |
| 61 | 62 | Mahabharat | 2013 | NR | 8.8 | NA | NA | Saurabh Jain,Shaheer Sheikh,Pooja Sharma,Arav ... | Drama,War | India | ... | 20 | tv series | 1 | 1 | 0 | 0 | 0 | 1 | Netflix | 2 |
| 64 | 65 | All About Asado | 2016 | NR | 6.6 | NA | Tony Bueno,Emily Pattison | Abby Harrison | Talk-Show | United States | ... | 89 | tv series | NA | 1 | 0 | 0 | 0 | 1 | Netflix | 3 |
5 rows × 22 columns
mixed_languages_count = df_tvshows_mixed_languages.groupby('Language')['Title'].count()
mixed_languages_tvshows = df_tvshows_mixed_languages.groupby('Language')[['Netflix', 'Hulu', 'Prime Video', 'Disney+']].sum()
mixed_languages_data_tvshows = pd.concat([mixed_languages_count, mixed_languages_tvshows], axis = 1).reset_index().rename(columns = {'Title' : 'TV Shows Count', 'Language' : 'Mixed Language'})
mixed_languages_data_tvshows = mixed_languages_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)
mixed_languages_data_tvshows.head(5)
| Mixed Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 176 | Japanese,English | 67 | 21 | 54 | 11 | 0 |
| 44 | English,French | 25 | 11 | 4 | 13 | 0 |
| 111 | English,Spanish | 25 | 10 | 12 | 7 | 1 |
| 79 | English,Japanese | 22 | 8 | 14 | 6 | 0 |
| 213 | Spanish,English | 11 | 6 | 5 | 1 | 1 |
# Mixed Language with TV Shows Counts - All Platforms Combined
mixed_languages_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)[:10]
| Mixed Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 176 | Japanese,English | 67 | 21 | 54 | 11 | 0 |
| 111 | English,Spanish | 25 | 10 | 12 | 7 | 1 |
| 44 | English,French | 25 | 11 | 4 | 13 | 0 |
| 79 | English,Japanese | 22 | 8 | 14 | 6 | 0 |
| 213 | Spanish,English | 11 | 6 | 5 | 1 | 1 |
| 145 | French,English | 8 | 3 | 4 | 1 | 1 |
| 85 | English,Korean | 7 | 1 | 3 | 1 | 3 |
| 55 | English,German | 7 | 2 | 2 | 3 | 1 |
| 183 | Korean,English | 6 | 5 | 0 | 2 | 0 |
| 20 | English,Arabic | 6 | 2 | 2 | 3 | 0 |
df_mixed_languages_high_tvshows = mixed_languages_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False).reset_index()
df_mixed_languages_high_tvshows = df_mixed_languages_high_tvshows.drop(['index'], axis = 1)
# filter = (mixed_languages_data_tvshows['TV Shows Count'] = = (mixed_languages_data_tvshows['TV Shows Count'].max()))
# df_mixed_languages_high_tvshows = mixed_languages_data_tvshows[filter]
# highest_rated_tvshows = mixed_languages_data_tvshows.loc[mixed_languages_data_tvshows['TV Shows Count'].idxmax()]
print('\nMixed Language with Highest Ever TV Shows Count are : All Platforms Combined\n')
df_mixed_languages_high_tvshows.head(5)
Mixed Language with Highest Ever TV Shows Count are : All Platforms Combined
| Mixed Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | Japanese,English | 67 | 21 | 54 | 11 | 0 |
| 1 | English,Spanish | 25 | 10 | 12 | 7 | 1 |
| 2 | English,French | 25 | 11 | 4 | 13 | 0 |
| 3 | English,Japanese | 22 | 8 | 14 | 6 | 0 |
| 4 | Spanish,English | 11 | 6 | 5 | 1 | 1 |
fig = px.bar(y = df_mixed_languages_high_tvshows['Mixed Language'][:15],
x = df_mixed_languages_high_tvshows['TV Shows Count'][:15],
color = df_mixed_languages_high_tvshows['TV Shows Count'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Mixed Language'},
title = 'TV Shows with Highest Number of Mixed Languages : All Platforms')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
df_mixed_languages_low_tvshows = mixed_languages_data_tvshows.sort_values(by = 'TV Shows Count', ascending = True).reset_index()
df_mixed_languages_low_tvshows = df_mixed_languages_low_tvshows.drop(['index'], axis = 1)
# filter = (mixed_languages_data_tvshows['TV Shows Count'] = = (mixed_languages_data_tvshows['TV Shows Count'].min()))
# df_mixed_languages_low_tvshows = mixed_languages_data_tvshows[filter]
print('\nMixed Language with Lowest Ever TV Shows Count are : All Platforms Combined\n')
df_mixed_languages_low_tvshows.head(5)
Mixed Language with Lowest Ever TV Shows Count are : All Platforms Combined
| Mixed Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | Japanese,English,Korean,Hindi | 1 | 1 | 0 | 0 | 0 |
| 1 | English,French,Spanish | 1 | 0 | 1 | 0 | 0 |
| 2 | English,French,Spanish,Catalan,Russian,Polish,... | 1 | 0 | 1 | 0 | 0 |
| 3 | English,German,Arabic,Russian,French | 1 | 0 | 0 | 1 | 0 |
| 4 | English,German,French,Italian,Turkish | 1 | 1 | 0 | 0 | 0 |
fig = px.bar(y = df_mixed_languages_low_tvshows['Mixed Language'][:15],
x = df_mixed_languages_low_tvshows['TV Shows Count'][:15],
color = df_mixed_languages_low_tvshows['TV Shows Count'][:15],
color_continuous_scale = 'Teal_r',
labels = { 'y' : 'TV Shows', 'x' : 'Number of Mixed Language'},
title = 'TV Shows with Lowest Number of Mixed Languages : All Platforms')
fig.update_layout(plot_bgcolor = 'white')
fig.show()
print(f'''
Total '{df_tvshows_languages['Language'].count()}' Titles are available on All Platforms, out of which\n
You Can Choose to see TV Shows from Total '{mixed_languages_data_tvshows['Mixed Language'].unique().shape[0]}' Mixed Language, They were Like this, \n
{mixed_languages_data_tvshows.sort_values(by = 'TV Shows Count', ascending = False)['Mixed Language'].head(5).unique()} etc. \n
The Mixed Language with Highest TV Shows Count have '{mixed_languages_data_tvshows['TV Shows Count'].max()}' TV Shows Available is '{df_mixed_languages_high_tvshows['Mixed Language'][0]}', &\n
The Mixed Language with Lowest TV Shows Count have '{mixed_languages_data_tvshows['TV Shows Count'].min()}' TV Shows Available is '{df_mixed_languages_low_tvshows['Mixed Language'][0]}'
''')
Total '4794' Titles are available on All Platforms, out of which
You Can Choose to see TV Shows from Total '245' Mixed Language, They were Like this,
['Japanese,English' 'English,Spanish' 'English,French' 'English,Japanese'
'Spanish,English'] etc.
The Mixed Language with Highest TV Shows Count have '67' TV Shows Available is 'Japanese,English', &
The Mixed Language with Lowest TV Shows Count have '1' TV Shows Available is 'Japanese,English,Korean,Hindi'
fig = px.pie(mixed_languages_data_tvshows[:10], names = 'Mixed Language', values = 'TV Shows Count', color_discrete_sequence = px.colors.sequential.Teal)
fig.update_traces(textposition = 'inside', textinfo = 'percent+label', title = 'TV Shows Count based on Mixed Language')
fig.show()
# netflix_mixed_languages_tvshows = mixed_languages_data_tvshows[mixed_languages_data_tvshows['Netflix'] != 0].sort_values(by = 'Netflix', ascending = False).reset_index()
# netflix_mixed_languages_tvshows = netflix_mixed_languages_tvshows.drop(['index', 'Hulu', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
netflix_mixed_languages_high_tvshows = df_mixed_languages_high_tvshows.sort_values(by = 'Netflix', ascending = False).reset_index()
netflix_mixed_languages_high_tvshows = netflix_mixed_languages_high_tvshows.drop(['index'], axis = 1)
netflix_mixed_languages_low_tvshows = df_mixed_languages_high_tvshows.sort_values(by = 'Netflix', ascending = True).reset_index()
netflix_mixed_languages_low_tvshows = netflix_mixed_languages_low_tvshows.drop(['index'], axis = 1)
netflix_mixed_languages_high_tvshows.head(5)
| Mixed Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | Japanese,English | 67 | 21 | 54 | 11 | 0 |
| 1 | English,French | 25 | 11 | 4 | 13 | 0 |
| 2 | English,Spanish | 25 | 10 | 12 | 7 | 1 |
| 3 | English,Japanese | 22 | 8 | 14 | 6 | 0 |
| 4 | Spanish,English | 11 | 6 | 5 | 1 | 1 |
# hulu_mixed_languages_tvshows = mixed_languages_data_tvshows[mixed_languages_data_tvshows['Hulu'] != 0].sort_values(by = 'Hulu', ascending = False).reset_index()
# hulu_mixed_languages_tvshows = hulu_mixed_languages_tvshows.drop(['index', 'Netflix', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
hulu_mixed_languages_high_tvshows = df_mixed_languages_high_tvshows.sort_values(by = 'Hulu', ascending = False).reset_index()
hulu_mixed_languages_high_tvshows = hulu_mixed_languages_high_tvshows.drop(['index'], axis = 1)
hulu_mixed_languages_low_tvshows = df_mixed_languages_high_tvshows.sort_values(by = 'Hulu', ascending = True).reset_index()
hulu_mixed_languages_low_tvshows = hulu_mixed_languages_low_tvshows.drop(['index'], axis = 1)
hulu_mixed_languages_high_tvshows.head(5)
| Mixed Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | Japanese,English | 67 | 21 | 54 | 11 | 0 |
| 1 | English,Japanese | 22 | 8 | 14 | 6 | 0 |
| 2 | English,Spanish | 25 | 10 | 12 | 7 | 1 |
| 3 | Spanish,English | 11 | 6 | 5 | 1 | 1 |
| 4 | English,French | 25 | 11 | 4 | 13 | 0 |
# prime_video_mixed_languages_tvshows = mixed_languages_data_tvshows[mixed_languages_data_tvshows['Prime Video'] != 0].sort_values(by = 'Prime Video', ascending = False).reset_index()
# prime_video_mixed_languages_tvshows = prime_video_mixed_languages_tvshows.drop(['index', 'Netflix', 'Hulu', 'Disney+', 'TV Shows Count'], axis = 1)
prime_video_mixed_languages_high_tvshows = df_mixed_languages_high_tvshows.sort_values(by = 'Prime Video', ascending = False).reset_index()
prime_video_mixed_languages_high_tvshows = prime_video_mixed_languages_high_tvshows.drop(['index'], axis = 1)
prime_video_mixed_languages_low_tvshows = df_mixed_languages_high_tvshows.sort_values(by = 'Prime Video', ascending = True).reset_index()
prime_video_mixed_languages_low_tvshows = prime_video_mixed_languages_low_tvshows.drop(['index'], axis = 1)
prime_video_mixed_languages_high_tvshows.head(5)
| Mixed Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | English,French | 25 | 11 | 4 | 13 | 0 |
| 1 | Japanese,English | 67 | 21 | 54 | 11 | 0 |
| 2 | English,Spanish | 25 | 10 | 12 | 7 | 1 |
| 3 | English,Japanese | 22 | 8 | 14 | 6 | 0 |
| 4 | English,German | 7 | 2 | 2 | 3 | 1 |
# disney_mixed_languages_tvshows = mixed_languages_data_tvshows[mixed_languages_data_tvshows['Disney+'] != 0].sort_values(by = 'Disney+', ascending = False).reset_index()
# disney_mixed_languages_tvshows = disney_mixed_languages_tvshows.drop(['index', 'Netflix', 'Hulu', 'Prime Video', 'TV Shows Count'], axis = 1)
disney_mixed_languages_high_tvshows = df_mixed_languages_high_tvshows.sort_values(by = 'Disney+', ascending = False).reset_index()
disney_mixed_languages_high_tvshows = disney_mixed_languages_high_tvshows.drop(['index'], axis = 1)
disney_mixed_languages_low_tvshows = df_mixed_languages_high_tvshows.sort_values(by = 'Disney+', ascending = True).reset_index()
disney_mixed_languages_low_tvshows = disney_mixed_languages_low_tvshows.drop(['index'], axis = 1)
disney_mixed_languages_high_tvshows.head(5)
| Mixed Language | TV Shows Count | Netflix | Hulu | Prime Video | Disney+ | |
|---|---|---|---|---|---|---|
| 0 | English,Korean | 7 | 1 | 3 | 1 | 3 |
| 1 | English,Czech,German | 2 | 0 | 0 | 0 | 2 |
| 2 | English,German | 7 | 2 | 2 | 3 | 1 |
| 3 | English,Spanish,Japanese | 1 | 0 | 1 | 0 | 1 |
| 4 | English,Spanish,Indonesian,Chinese,Arabic,Russ... | 1 | 0 | 0 | 0 | 1 |
f, ax = plt.subplots(1, 2 , figsize = (20, 5))
sns.distplot(mixed_languages_data_tvshows['TV Shows Count'], bins = 20, kde = True, ax = ax[0])
sns.boxplot(mixed_languages_data_tvshows['TV Shows Count'], ax = ax[1])
plt.show()
# Creating distinct dataframes only with the tvshows present on individual streaming platforms
netflix_mixed_languages_tvshows = mixed_languages_data_tvshows[mixed_languages_data_tvshows['Netflix'] != 0].sort_values(by = 'Netflix', ascending = False).reset_index()
netflix_mixed_languages_tvshows = netflix_mixed_languages_tvshows.drop(['index', 'Hulu', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
hulu_mixed_languages_tvshows = mixed_languages_data_tvshows[mixed_languages_data_tvshows['Hulu'] != 0].sort_values(by = 'Hulu', ascending = False).reset_index()
hulu_mixed_languages_tvshows = hulu_mixed_languages_tvshows.drop(['index', 'Netflix', 'Prime Video', 'Disney+', 'TV Shows Count'], axis = 1)
prime_video_mixed_languages_tvshows = mixed_languages_data_tvshows[mixed_languages_data_tvshows['Prime Video'] != 0].sort_values(by = 'Prime Video', ascending = False).reset_index()
prime_video_mixed_languages_tvshows = prime_video_mixed_languages_tvshows.drop(['index', 'Netflix', 'Hulu', 'Disney+', 'TV Shows Count'], axis = 1)
disney_mixed_languages_tvshows = mixed_languages_data_tvshows[mixed_languages_data_tvshows['Disney+'] != 0].sort_values(by = 'Disney+', ascending = False).reset_index()
disney_mixed_languages_tvshows = disney_mixed_languages_tvshows.drop(['index', 'Netflix', 'Hulu', 'Prime Video', 'TV Shows Count'], axis = 1)
# Defining plot size and title
plt.figure(figsize = (20, 5))
plt.title('Mixed Language TV Shows Count Per Platform')
# Plotting the information from each dataset into a histogram
sns.histplot(prime_video_mixed_languages_tvshows['Prime Video'][:100], color = 'lightblue', legend = True, kde = True)
sns.histplot(netflix_mixed_languages_tvshows['Netflix'][:100], color = 'red', legend = True, kde = True)
sns.histplot(hulu_mixed_languages_tvshows['Hulu'][:100], color = 'lightgreen', legend = True, kde = True)
sns.histplot(disney_mixed_languages_tvshows['Disney+'][:100], color = 'darkblue', legend = True, kde = True)
# Setting the legend
plt.legend(['Prime Video', 'Netflix', 'Hulu', 'Disney+'])
plt.show()
print(f'''
The Mixed Language with Highest TV Shows Count Ever Got is '{df_mixed_languages_high_tvshows['Mixed Language'][0]}' : '{df_mixed_languages_high_tvshows['TV Shows Count'].max()}'\n
The Mixed Language with Lowest TV Shows Count Ever Got is '{df_mixed_languages_low_tvshows['Mixed Language'][0]}' : '{df_mixed_languages_low_tvshows['TV Shows Count'].min()}'\n
The Mixed Language with Highest TV Shows Count on 'Netflix' is '{netflix_mixed_languages_high_tvshows['Mixed Language'][0]}' : '{netflix_mixed_languages_high_tvshows['Netflix'].max()}'\n
The Mixed Language with Lowest TV Shows Count on 'Netflix' is '{netflix_mixed_languages_low_tvshows['Mixed Language'][0]}' : '{netflix_mixed_languages_low_tvshows['Netflix'].min()}'\n
The Mixed Language with Highest TV Shows Count on 'Hulu' is '{hulu_mixed_languages_high_tvshows['Mixed Language'][0]}' : '{hulu_mixed_languages_high_tvshows['Hulu'].max()}'\n
The Mixed Language with Lowest TV Shows Count on 'Hulu' is '{hulu_mixed_languages_low_tvshows['Mixed Language'][0]}' : '{hulu_mixed_languages_low_tvshows['Hulu'].min()}'\n
The Mixed Language with Highest TV Shows Count on 'Prime Video' is '{prime_video_mixed_languages_high_tvshows['Mixed Language'][0]}' : '{prime_video_mixed_languages_high_tvshows['Prime Video'].max()}'\n
The Mixed Language with Lowest TV Shows Count on 'Prime Video' is '{prime_video_mixed_languages_low_tvshows['Mixed Language'][0]}' : '{prime_video_mixed_languages_low_tvshows['Prime Video'].min()}'\n
The Mixed Language with Highest TV Shows Count on 'Disney+' is '{disney_mixed_languages_high_tvshows['Mixed Language'][0]}' : '{disney_mixed_languages_high_tvshows['Disney+'].max()}'\n
The Mixed Language with Lowest TV Shows Count on 'Disney+' is '{disney_mixed_languages_low_tvshows['Mixed Language'][0]}' : '{disney_mixed_languages_low_tvshows['Disney+'].min()}'\n
''')
The Mixed Language with Highest TV Shows Count Ever Got is 'Japanese,English' : '67'
The Mixed Language with Lowest TV Shows Count Ever Got is 'Japanese,English,Korean,Hindi' : '1'
The Mixed Language with Highest TV Shows Count on 'Netflix' is 'Japanese,English' : '21'
The Mixed Language with Lowest TV Shows Count on 'Netflix' is 'English,Dutch,French,German,Lithuanian' : '0'
The Mixed Language with Highest TV Shows Count on 'Hulu' is 'Japanese,English' : '54'
The Mixed Language with Lowest TV Shows Count on 'Hulu' is 'English,Egyptian (Ancient),Russian,Latin,Arabic,Japanese' : '0'
The Mixed Language with Highest TV Shows Count on 'Prime Video' is 'English,French' : '13'
The Mixed Language with Lowest TV Shows Count on 'Prime Video' is 'English,Egyptian (Ancient),Russian,Latin,Arabic,Japanese' : '0'
The Mixed Language with Highest TV Shows Count on 'Disney+' is 'English,Korean' : '3'
The Mixed Language with Lowest TV Shows Count on 'Disney+' is 'Japanese,English' : '0'
print(f'''
Accross All Platforms the Average TV Shows Count of Mixed Language is '{round(mixed_languages_data_tvshows['TV Shows Count'].mean(), ndigits = 2)}'\n
The Average TV Shows Count of Mixed Language on 'Netflix' is '{round(netflix_mixed_languages_tvshows['Netflix'].mean(), ndigits = 2)}'\n
The Average TV Shows Count of Mixed Language on 'Hulu' is '{round(hulu_mixed_languages_tvshows['Hulu'].mean(), ndigits = 2)}'\n
The Average TV Shows Count of Mixed Language on 'Prime Video' is '{round(prime_video_mixed_languages_tvshows['Prime Video'].mean(), ndigits = 2)}'\n
The Average TV Shows Count of Mixed Language on 'Disney+' is '{round(disney_mixed_languages_tvshows['Disney+'].mean(), ndigits = 2)}'\n
''')
Accross All Platforms the Average TV Shows Count of Mixed Language is '1.93'
The Average TV Shows Count of Mixed Language on 'Netflix' is '1.57'
The Average TV Shows Count of Mixed Language on 'Hulu' is '2.28'
The Average TV Shows Count of Mixed Language on 'Prime Video' is '1.54'
The Average TV Shows Count of Mixed Language on 'Disney+' is '1.23'
print(f'''
Accross All Platforms Total Count of Mixed Language is '{mixed_languages_data_tvshows['Mixed Language'].unique().shape[0]}'\n
Total Count of Mixed Language on 'Netflix' is '{netflix_mixed_languages_tvshows['Mixed Language'].unique().shape[0]}'\n
Total Count of Mixed Language on 'Hulu' is '{hulu_mixed_languages_tvshows['Mixed Language'].unique().shape[0]}'\n
Total Count of Mixed Language on 'Prime Video' is '{prime_video_mixed_languages_tvshows['Mixed Language'].unique().shape[0]}'\n
Total Count of Mixed Language on 'Disney+' is '{disney_mixed_languages_tvshows['Mixed Language'].unique().shape[0]}'\n
''')
Accross All Platforms Total Count of Mixed Language is '245'
Total Count of Mixed Language on 'Netflix' is '134'
Total Count of Mixed Language on 'Hulu' is '74'
Total Count of Mixed Language on 'Prime Video' is '97'
Total Count of Mixed Language on 'Disney+' is '13'
plt.figure(figsize = (20, 5))
sns.lineplot(x = mixed_languages_data_tvshows['Mixed Language'][:5], y = mixed_languages_data_tvshows['Netflix'][:5], color = 'red')
sns.lineplot(x = mixed_languages_data_tvshows['Mixed Language'][:5], y = mixed_languages_data_tvshows['Hulu'][:5], color = 'lightgreen')
sns.lineplot(x = mixed_languages_data_tvshows['Mixed Language'][:5], y = mixed_languages_data_tvshows['Prime Video'][:5], color = 'lightblue')
sns.lineplot(x = mixed_languages_data_tvshows['Mixed Language'][:5], y = mixed_languages_data_tvshows['Disney+'][:5], color = 'darkblue')
plt.xlabel('Mixed Language', fontsize = 15)
plt.ylabel('TV Shows Count', fontsize = 15)
plt.show()
fig, axes = plt.subplots(2, 2, figsize = (20 , 20))
n_l_ax1 = sns.barplot(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['Netflix'][:10], palette = 'Reds_r', ax = axes[0, 0])
h_l_ax2 = sns.barplot(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['Hulu'][:10], palette = 'Greens_r', ax = axes[0, 1])
p_l_ax3 = sns.barplot(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['Prime Video'][:10], palette = 'Blues_r', ax = axes[1, 0])
d_l_ax4 = sns.barplot(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['Disney+'][:10], palette = 'BuPu_r', ax = axes[1, 1])
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
n_l_ax1.title.set_text(labels[0])
h_l_ax2.title.set_text(labels[1])
p_l_ax3.title.set_text(labels[2])
d_l_ax4.title.set_text(labels[3])
plt.show()
fig, axes = plt.subplots(2, 2, figsize = (20 , 10))
n_ml_ax1 = sns.lineplot(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['Netflix'][:10], color = 'red', ax = axes[0, 0])
h_ml_ax2 = sns.lineplot(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['Hulu'][:10], color = 'lightgreen', ax = axes[0, 1])
p_ml_ax3 = sns.lineplot(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['Prime Video'][:10], color = 'lightblue', ax = axes[1, 0])
d_ml_ax4 = sns.lineplot(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['Disney+'][:10], color = 'darkblue', ax = axes[1, 1])
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
n_ml_ax1.title.set_text(labels[0])
h_ml_ax2.title.set_text(labels[1])
p_ml_ax3.title.set_text(labels[2])
d_ml_ax4.title.set_text(labels[3])
plt.show()
# Defining plot size and title
plt.figure(figsize = (20, 5))
plt.title('Mixed Language TV Shows Count Per Platform')
# Plotting the information from each dataset into a histogram
sns.kdeplot(netflix_mixed_languages_tvshows['Netflix'][:50], color = 'red', legend = True)
sns.kdeplot(hulu_mixed_languages_tvshows['Hulu'][:50], color = 'green', legend = True)
sns.kdeplot(prime_video_mixed_languages_tvshows['Prime Video'][:50], color = 'lightblue', legend = True)
sns.kdeplot(disney_mixed_languages_tvshows['Disney+'][:50], color = 'darkblue', legend = True)
# Setting the legend
plt.legend(['Netflix', 'Hulu', 'Prime Video', 'Disney+'])
plt.show()
fig, axes = plt.subplots(2, 2, figsize = (20 , 20))
n_ml_ax1 = sns.barplot(y = netflix_mixed_languages_tvshows['Mixed Language'][:10], x = netflix_mixed_languages_tvshows['Netflix'][:10], palette = 'Reds_r', ax = axes[0, 0])
h_ml_ax2 = sns.barplot(y = hulu_mixed_languages_tvshows['Mixed Language'][:10], x = hulu_mixed_languages_tvshows['Hulu'][:10], palette = 'Greens_r', ax = axes[0, 1])
p_ml_ax3 = sns.barplot(y = prime_video_mixed_languages_tvshows['Mixed Language'][:10], x = prime_video_mixed_languages_tvshows['Prime Video'][:10], palette = 'Blues_r', ax = axes[1, 0])
d_ml_ax4 = sns.barplot(y = disney_mixed_languages_tvshows['Mixed Language'][:10], x = disney_mixed_languages_tvshows['Disney+'][:10], palette = 'BuPu_r', ax = axes[1, 1])
labels = ['Netflix', 'Hulu', 'Prime Video', 'Disney+']
n_ml_ax1.title.set_text(labels[0])
h_ml_ax2.title.set_text(labels[1])
p_ml_ax3.title.set_text(labels[2])
d_ml_ax4.title.set_text(labels[3])
plt.show()
fig = go.Figure(go.Funnel(y = mixed_languages_data_tvshows['Mixed Language'][:10], x = mixed_languages_data_tvshows['TV Shows Count'][:10]))
fig.show()